﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/MasterPage_Inicial.Master"
    AutoEventWireup="true" CodeBehind="CadastroCliente.aspx.cs" Inherits="Manager.Formularios_Cadastro.CadastroCliente" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/Componente/ControleContatos.ascx" TagName="ControleContato" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="/Styles/Tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/StyleTextBox.css" rel="stylesheet" type="text/css" />
    <%--<link href="/Styles/StyleGrid.css" rel="stylesheet" type="text/css" />--%>
    <link href="/Styles/StyleGridCliente.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/StyleAccordion.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/StyleModal.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="server">
    <div style="width: 100%; height: 100%">
        <asp:Accordion ID="AccordionCadastroCliente" runat="server" SelectedIndex="-1" HeaderCssClass="accordionHeader"
            HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent"
            AutoSize="None" FadeTransitions="true" TransitionDuration="250" FramesPerSecond="40"
            RequireOpenedPane="false" SuppressHeaderPostbacks="true" Width="100%" Visible="true">
            <Panes>
                <asp:AccordionPane HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected"
                    ContentCssClass="accordionContent">
                    <Header>
                        Cadastrar Novo Cliente</Header>
                    <Content>
                        <asp:UpdatePanel ID="PanelUpdate" runat="server">
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="btCancelar" EventName="Click"></asp:AsyncPostBackTrigger>
                                <asp:AsyncPostBackTrigger ControlID="btSalvar" EventName="Click"></asp:AsyncPostBackTrigger>
<asp:AsyncPostBackTrigger ControlID="txtCep" EventName="Unload" />
                            </Triggers>
                            <ContentTemplate>
                                <div style="width: 100%; height: 100%">
                                    <table>
                                        <tr>
                                            <td>
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <asp:TextBox ID="txtNomeFantasia" runat="server" BorderColor="Red" BorderStyle="Solid"
                                                                BorderWidth="2px" CssClass="nonwatermarked" Font-Names="Calibri" Font-Size="16px"
                                                                Height="18px" Width="250px"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorNomeFantasia" runat="server"
                                                                ErrorMessage="O campo deve ser preenchido!" Display="None" ControlToValidate="txtNomeFantasia">
                                                            </asp:RequiredFieldValidator>
                                                            <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="txtNomeFantasia"
                                                                WatermarkText="Razão Social" WatermarkCssClass="watermarked" Enabled="True">
                                                            </asp:TextBoxWatermarkExtender>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtEmpresa" runat="server" BorderColor="Red" BorderStyle="Solid"
                                                                BorderWidth="2px" CssClass="nonwatermarked" Font-Names="Calibri" Font-Size="16px"
                                                                Height="18px" Width="250px"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="txtEmpresa_RequiredFieldValidator" runat="server"
                                                                ErrorMessage="O campo deve ser preenchido!" Display="None" ControlToValidate="txtEmpresa">
                                                            </asp:RequiredFieldValidator>
                                                            <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtenderEmpresa" runat="server"
                                                                TargetControlID="txtEmpresa" WatermarkText="Nome Empresa" WatermarkCssClass="watermarked"
                                                                Enabled="True">
                                                            </asp:TextBoxWatermarkExtender>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <table cellpadding="0">
                                                    <tr>
                                                        <td>
                                                            <asp:TextBox ID="txtCep" runat="server" BorderColor="Red" BorderStyle="Solid" BorderWidth="2px"
                                                                CssClass="nonwatermarked" Font-Names="Calibri" Font-Size="16px" Height="18px"
                                                                Width="90px" AutoPostBack="True"></asp:TextBox>
                                                            <asp:MaskedEditExtender ID="txtCep_MaskedEditExtender" runat="server" Mask="99.999-999"
                                                                TargetControlID="txtCep">
                                                            </asp:MaskedEditExtender>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorCep" runat="server" ErrorMessage="O campo deve ser preenchido!"
                                                                Display="None" ControlToValidate="txtCep">
                                                            </asp:RequiredFieldValidator>
                                                            <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtenderCep" runat="server" TargetControlID="txtCep"
                                                                WatermarkText="Cep" WatermarkCssClass="watermarked" Enabled="True">
                                                            </asp:TextBoxWatermarkExtender>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtEndereco" runat="server" BorderColor="Red" BorderStyle="Solid"
                                                                BorderWidth="2px" CssClass="nonwatermarked" Font-Names="Calibri" Font-Size="16px"
                                                                Height="18px" Width="298px"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorEndereco" runat="server" ErrorMessage="O campo deve ser preenchido!"
                                                                Display="None" ControlToValidate="txtEndereco">
                                                            </asp:RequiredFieldValidator>
                                                            <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtenderEndereco" runat="server"
                                                                TargetControlID="txtEndereco" WatermarkText="Endereço" WatermarkCssClass="watermarked"
                                                                Enabled="True">
                                                            </asp:TextBoxWatermarkExtender>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtNumero" runat="server" BorderColor="Red" BorderStyle="Solid"
                                                                BorderWidth="2px" CssClass="nonwatermarked" Font-Names="Calibri" Font-Size="16px"
                                                                Height="18px" Width="70px"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorNumero" runat="server" ErrorMessage="O campo deve ser preenchido!"
                                                                Display="None" ControlToValidate="txtNumero">
                                                            </asp:RequiredFieldValidator>
                                                            <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtenderNumero" runat="server"
                                                                TargetControlID="txtNumero" WatermarkText="Número" WatermarkCssClass="watermarked"
                                                                Enabled="True">
                                                            </asp:TextBoxWatermarkExtender>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtBairro" runat="server" BorderColor="Red" BorderStyle="Solid"
                                                                BorderWidth="2px" CssClass="nonwatermarked" Font-Names="Calibri" Font-Size="16px"
                                                                Height="18px" Width="155px"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorBairro" runat="server" ErrorMessage="O campo deve ser preenchido!"
                                                                Display="None" ControlToValidate="txtBairro">
                                                            </asp:RequiredFieldValidator>
                                                            <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtenderBairro" runat="server"
                                                                TargetControlID="txtBairro" WatermarkText="Bairro" WatermarkCssClass="watermarked"
                                                                Enabled="True">
                                                            </asp:TextBoxWatermarkExtender>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtCidade" runat="server" BorderColor="Red" BorderStyle="Solid"
                                                                BorderWidth="2px" CssClass="nonwatermarked" Font-Names="Calibri" Font-Size="16px"
                                                                Height="18px" Width="155px"></asp:TextBox>
                                                            <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtenderCidade" runat="server"
                                                                TargetControlID="txtCidade" WatermarkText="Cidade" WatermarkCssClass="watermarked"
                                                                Enabled="True">
                                                            </asp:TextBoxWatermarkExtender>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtUf" runat="server" BorderColor="Red" BorderStyle="Solid" BorderWidth="2px"
                                                                CssClass="nonwatermarked" Font-Names="Calibri" Font-Size="16px" Height="18px"
                                                                Width="25px"></asp:TextBox>
                                                            <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtenderUf" runat="server" TargetControlID="txtUf"
                                                                WatermarkText="UF" WatermarkCssClass="watermarked" Enabled="True">
                                                            </asp:TextBoxWatermarkExtender>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 1px;">
                                                <asp:TextBox ID="txtObservacao" runat="server" BorderColor="Red" BorderStyle="Solid"
                                                    BorderWidth="2px" CssClass="nonwatermarked" Font-Names="Calibri" Font-Size="16px"
                                                    Height="18px" Width="500px"></asp:TextBox>
                                                <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender2" runat="server" TargetControlID="txtObservacao"
                                                    WatermarkText="Complemento" WatermarkCssClass="watermarked" Enabled="True">
                                                </asp:TextBoxWatermarkExtender>
                                            </td>
                                        </tr>
                                    </table>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:ImageButton ID="btSalvar" runat="server" ImageUrl="~/Botao/Componentes/Salvar.png"
                                                    OnClick="btSalvar_Click" />
                                            </td>
                                            <td>
                                                <asp:ImageButton ID="btCancelar" runat="server" ImageUrl="~/Botao/Componentes/Limpar.png"
                                                    OnClick="btLimpar_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </Content>
                </asp:AccordionPane>
            </Panes>
        </asp:Accordion>
        <div style="margin-top: 12px;">
            <table style="width: 100%; background: white;" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="left" valign="middle" style="padding-left: 5px; background-image: url('/Layout/Layout_Topicos_Teste.png');
                        background-repeat: repeat-x; width: 100%; height: 30px;">
                        <asp:Label ID="Label3" runat="server" Font-Size="Medium" ForeColor="#333333" Text="Clientes Cadastradas"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td style="background: white;">
                        <asp:GridView ID="gwCliente" runat="server" AutoGenerateColumns="False" GridLines="None"
                            ShowHeader="False" Width="100%" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"
                            OnRowCommand="gwCliente_RowCommand">
                            <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                            <Columns>
                                <asp:BoundField DataField="idCliente">
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" Font-Size="Medium"
                                        ForeColor="#333333" />
                                </asp:BoundField>
                                <asp:BoundField DataField="nomeFantasia">
                                    <ItemStyle Font-Size="Medium" ForeColor="#7B98A8" HorizontalAlign="Left" VerticalAlign="Middle" />
                                </asp:BoundField>
                                <asp:ButtonField ButtonType="Image" CommandName="VerContatos" ImageUrl="~/Imagens/Grid/Grid_Contato.png"
                                    Text="Button" FooterText="Contatos">
                                    <ItemStyle Width="50px" HorizontalAlign="Center" />
                                </asp:ButtonField>
                            </Columns>
                            <EditRowStyle ForeColor="Red" />
                            <PagerStyle CssClass="pgr"></PagerStyle>
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>
